package com.kaiyiweitong.tongxing.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.GridLayout;

import com.kaiyiweitong.tongxing.R;
import com.kaiyiweitong.tongxing.base.ClassifyHorAdapter;
import com.kaiyiweitong.tongxing.adapter.TypeItemAdapter;
import com.kaiyiweitong.tongxing.base.BaseActivity;

/**
 * Created by Administrator on 2017/12/17 0017.
 */

public class TypeActivity extends BaseActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_type);
        init();
    }

    private void init() {
        RecyclerView rv_type_hor = (RecyclerView) findViewById(R.id.rv_type_hor);
        rv_type_hor.setLayoutManager(new GridLayoutManager(this, 1, GridLayout.HORIZONTAL, false));
        ClassifyHorAdapter typeAdapter = new ClassifyHorAdapter(this);
        rv_type_hor.setAdapter(typeAdapter);

        RecyclerView rv_type_item = (RecyclerView) findViewById(R.id.rv_type_item);
        rv_type_item.setLayoutManager(new GridLayoutManager(this, 1, GridLayout.VERTICAL, false));
        TypeItemAdapter typeItemAdapter = new TypeItemAdapter(this);
        rv_type_item.setAdapter(typeItemAdapter);
    }
}
